#pragma once
#define QAPI_CALL __cdecl
// By Zero123
#ifdef _MSC_VER
#define QAPI_EXPORT extern "C" __declspec(dllexport)
#elif defined(__GNUC__)
#define QAPI_EXPORT extern "C" __attribute__((visibility("default")))
#else
#define QAPI_EXPORT extern "C"
#endif
#include <vector>

typedef void (QAPI_CALL* CSTRING_CALL_BACK)(const char*);

struct QArrayStruct
{
    void* head;
    int size;

    // QArrayStruct 解析为 std::vector<std::string>
    static std::vector<std::string> parseStringArray(const QArrayStruct& qArray)
    {
        std::vector<std::string> result;
        // 假设 head 指向的是一个 char* 数组
        char** stringArray = static_cast<char**>(qArray.head);
        for (int i = 0; i < qArray.size; ++i)
        {
            result.push_back(std::string(stringArray[i]));
        }
        return result;
    }
};